import { createRouter,createWebHistory } from 'vue-router'

const constantRoutes = [
    {
        path:"/login",
        name:"Login",
        component: () => import("pages/login/index.vue")
    },
    {
        path:"/",
        name:"Index",
        component: () => import("pages/index/index.vue")
    },
    {
        path:"/layout",
        component: () => import("pages/layout/index.vue"),
        children:[
            {
                path:"",
                name:"Home",
                component: () => import("pages/home/index.vue")
            },
            {
                path:"/qa",
                name:"Qa",
                component: () => import("pages/qa/index.vue")
            },
            {
                path:"/video",
                name:"Video",
                component: () => import("pages/video/index.vue")
            },
            {
                path:"/main",
                name:"Main",
                component: () => import("pages/main/index.vue")
            }
        ]
    },
    {
        path:"/user/chat",
        name:"Chat",
        component: () => import("pages/user-chat/index.vue")
    },
    {
        path:"/robot",
        name:"Robot",
        component: () => import("pages/robot/index.vue")
    },
    {
        path:"/details/:article_id",
        name:"Details",
        component: () => import("pages/home/components/details.vue")
    },
    {
        path:"/search",
        name:"Search",
        component: () => import("pages/home/components/search.vue")
    }
]

const router = createRouter({
    history:createWebHistory(),
    routes:constantRoutes
})


export default router